package com.laconic.vbenadmin;

import lombok.AllArgsConstructor;
import lombok.NoArgsConstructor;

/**
 * @Author JiangLiu
 * @Date 2025/5/23 00:56
 **/
@NoArgsConstructor
public class SingleResponse<T> {
    private long code;

    private String message;

    private T data;

    public SingleResponse(long code, String message, T data) {
        this.code = code;
        this.message = message;
        this.data = data;
    }

    public long getCode() {
        return code;
    }

    public void setCode(long code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public static <T> SingleResponse success(T data) {
        return new SingleResponse(0, "成功", data);
    }
}
